<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});


Route::group(['namespace' => 'Admin', 'prefix' => 'admin'], function () {


    Route::group(['prefix' => 'home'], function () {

        Route::any('home', 'HomeController@home');
        Route::any('orderInfo', 'HomeController@orderInfo');
        Route::any('getOrderList', 'HomeController@getOrderList');


    });

    Route::group(['prefix' => 'login'], function () {

        Route::any('login', 'LoginController@login');

        Route::any('add', 'LoginController@add');

    });

    Route::group(['prefix'=>'admin'],function (){

        Route::any('admin_list','AdminController@admin_list');

        Route::any('admin_update','AdminController@admin_update');

        Route::any('admin_info','AdminController@admin_info');

        Route::any('admin_delete/id/{id}','AdminController@admin_delete');

        Route::any('getAllGroupName','AdminController@getAllGroupName');

    });


    Route::group(['prefix'=>'rule'],function (){

        Route::any('rule_list','RulesController@rule_list');

        Route::any('rule_info/id/{id}','RulesController@rule_info');

        Route::any('rule_update','RulesController@rule_update');

        Route::any('rule_delete/id/{id}','RulesController@rule_delete');

    });

    Route::group(['prefix'=>'rule_group'],function (){

        Route::any('group_list','RuleGroupController@group_list');

        Route::any('all_rules','RuleGroupController@all_rules');

        Route::any('rule_update','RuleGroupController@rule_update');

        Route::any('get_rule_info/id/{id}','RuleGroupController@get_rule_info');

        Route::any('group_delete/id/{id}','RuleGroupController@group_delete');

    });


    Route::group(['prefix'=>'auth_test'],function (){

        Route::any('auth_test','AuthTestController@auth_test');
        Route::any('auth_test1','AuthTestController@auth_test1');
        Route::any('auth_test2','AuthTestController@auth_test2');
        Route::any('auth_test3','AuthTestController@auth_test3');


    });

    Route::group(['prefix'=>'menu'],function (){

        Route::any('getMenu','MenuController@getMenu');



    });


    Route::group(['prefix'=>"category"],function (){

        Route::any('categoryList','CategoryController@categoryList');

        Route::any('categoryUpdate','CategoryController@categoryUpdate');

        Route::any('categoryDelete','CategoryController@categoryDelete');

    });


    Route::group(['prefix'=>'upload'],function (){

        Route::any('upload','UploadController@upload');

    });

    Route::group(['prefix'=>'mail'],function (){

        Route::any('send','MailController@send');

    });


    Route::group(['prefix'=>'queue'],function (){

        Route::any('send','QueueController@send');
        Route::any('getTask','QueueController@getTask');
        Route::any('getDelayTask','QueueController@getDelayTask');
        Route::any('getPip','QueueController@getPip');

    });

    Route::group(['prefix'=>'test'],function (){

        Route::any('sql_test','TestController@sql_test');
        Route::any('test2','TestController@test2');

        Route::any('rule_test/{id}','TestController@rule_test');

    });


    Route::group(['prefix'=>'route'],function (){

        Route::any('getRouteTip','RouteController@getRouteTip');

    });

    Route::group(['prefix'=>'search'],function (){

        Route::any('search','SearchController@search');

    });

    Route::group(['prefix'=>'user'],function (){

        Route::any('info','UserController@info');

    });

    Route::group(['prefix'=>'email'],function (){

        Route::any('sendEmail','EmailController@sendEmail');
        Route::any('readExcel','EmailController@readExcel');

    });

    Route::group(['prefix'=>'common'],function (){

        Route::any('getCategoryList','CommonController@getCategoryList');
    });


    Route::group(['prefix'=>'goods'],function (){

        Route::any('goods_save','GoodsController@goods_save');
        Route::any('goods_list','GoodsController@goods_list');
        Route::any('goodsDownOrUp','GoodsController@goodsDownOrUp');
        Route::any('getDetail','GoodsController@getDetail');
        Route::any('goods_update','GoodsController@goods_update');
        Route::any('goods_delete','GoodsController@goods_delete');
        Route::any('delete_goods_sku','GoodsController@delete_goods_sku');


    });

    Route::group(['prefix'=>'index_model'],function (){

        Route::any('saveAd','IndexModelController@saveAd');
        Route::any('getDetail','IndexModelController@getDetail');
        Route::any('saveMessage','IndexModelController@saveMessage');
        Route::any('getMessageDetail','IndexModelController@getMessageDetail');
        Route::any('saveMode','IndexModelController@saveMode');
        Route::any('getMode','IndexModelController@getMode');

    });

    Route::group(['prefix'=>'weapp_user'],function (){

        Route::any('getList','WeappUserController@getList');


    });

    Route::group(['prefix'=>'order'],function (){

        Route::any('order_list','OrderController@order_list');
        Route::any('order_setting_save','OrderController@order_setting_save');
        Route::any('order_setting_detail','OrderController@order_setting_detail');
        Route::any('need_mention_order_list','OrderController@need_mention_order_list');


    });

    Route::group(['prefix'=>'refund'],function (){

        Route::any('refund_list','RefundController@refund_list');

        Route::any('do_refund','RefundController@do_refund');
        Route::any('refuse','RefundController@refuse');

    });


    Route::group(['prefix'=>'snapped'],function (){

        Route::any('getGoodsList','SnappedController@getGoodsList');
        Route::any('snappedSave','SnappedController@snappedSave');
        Route::any('snappedList','SnappedController@snappedList');
        Route::any('detail','SnappedController@detail');
        Route::any('snappedDelete','SnappedController@snappedDelete');
        Route::any('snappedDisable','SnappedController@snappedDisable');
        Route::any('snappedActive','SnappedController@snappedActive');

    });

    Route::group(['prefix'=>'store'],function (){

        Route::any('updateStore','StoreController@updateStore');
        Route::any('storeList','StoreController@storeList');
        Route::any('detail','StoreController@detail');
        Route::any('deleted','StoreController@deleted');

    });

    Route::group(['prefix'=>'receipt_code'],function (){

        Route::any('searchCode','ReceiptCodeController@searchCode');

        Route::any('orderFinishByCode','ReceiptCodeController@orderFinishByCode');

        Route::any('getQuerySmsTemplate','ReceiptCodeController@getQuerySmsTemplate');

    });


    Route::group(['prefix'=>'mention'],function (){

        Route::any('saveMention','MentionController@saveMention');

        Route::any('getList','MentionController@getList');

        Route::any('save','MentionController@save');

        Route::any('getItem','MentionController@getItem');
        Route::any('deleteMention','MentionController@deleteMention');



    });

    Route::group(['prefix'=>'coupon'],function (){

        Route::any('coupon_update','CouponController@coupon_update');
        Route::any('coupon_list','CouponController@coupon_list');
        Route::any('coupon_detail','CouponController@coupon_detail');
        Route::any('coupon_delete','CouponController@coupon_delete');

    });


});


Route::group(['namespace' => 'Weapp', 'prefix' => 'weapp'],function (){


    Route::group(['prefix'=>'login'],function (){

        Route::any('test','Login@test');
        Route::any('test3','Login@test3');

        Route::any('getSessionKey','Login@getSessionKey');
        Route::any('getPhone','Login@getPhone');
//        Route::any('loginByWeiXin','Login@loginByWeiXin');
        Route::any('getInfo','Login@getInfo');

    });


    Route::group(['prefix'=>'goods'],function (){

        Route::any('goods_detail','Goods@goods_detail');
        Route::any('detail','Goods@detail');
        Route::any('recommendGoods','Goods@recommendGoods');
        Route::any('getNewGoods','Goods@getNewGoods');
        Route::any('getShopCarNum','Goods@getShopCarNum');
        Route::any('collect_goods','Goods@collect_goods')->middleware('checkWeappToken');
        Route::any('addView','Goods@addView');
//        Route::any('goods_detail','Goods@goods_detail');
        Route::any('hot','Goods@hot');

    });

    Route::group(['prefix'=>'index_model'],function (){


        Route::any('getAd','IndexModel@getAd');
        Route::any('getMessage','IndexModel@getMessage');
        Route::any('getMode','IndexModel@getMode');
        Route::any('getListWithFixedMenu','IndexModel@getListWithFixedMenu');

    });

    Route::group(['prefix'=>'shop_car'],function (){


        Route::any('addGoods','ShopCar@addGoods');
        Route::any('getShopCarList','ShopCar@getShopCarList');
        Route::any('changeStatus','ShopCar@changeStatus');
        Route::any('deleteGoods','ShopCar@deleteGoods');
        Route::any('selectAll','ShopCar@selectAll');
        Route::any('cancelAll','ShopCar@cancelAll');
        Route::any('changeNum','ShopCar@changeNum');
//        Route::any('getMessage','IndexModel@getMessage');

    });


    Route::group(['prefix'=>'address'],function (){

        Route::any('saveAddress','Address@saveAddress');
        Route::any('addressList','Address@addressList');
        Route::any('getDetail','Address@getDetail');
        Route::any('deleteAddress','Address@deleteAddress');



    });


    Route::group(['prefix'=>'confirm'],function (){

        Route::any('getDefaultAddress','Confirm@getDefaultAddress');
        Route::any('getGoodsDetail','Confirm@getGoodsDetail');


    });

    Route::group(['prefix'=>'order'],function (){

        Route::any('create_order','Order@create_order');
        Route::any('getOrderDetail','Order@getOrderDetail');
        Route::any('my_order','Order@my_order');
        Route::any('order_cancel','Order@order_cancel');


    });


    Route::group(['prefix'=>'pay'],function (){

        Route::any('getPayParam','Pay@getPayParam');
//        Route::any('getOrderDetail','Order@getOrderDetail');


    });

    Route::group(['prefix'=>'notify'],function (){

        Route::any('checkOrderByWeChat','Notify@checkOrderByWeChat');
        Route::any('refundNotifyByWeChat','Notify@refundNotifyByWeChat');



    });

    Route::group(['prefix'=>'refund'],function (){

        Route::any('create_refund','Refund@create_refund');
        Route::any('order_detail','Refund@order_detail');
        Route::any('refund_list','Refund@refund_list');

    });


    Route::group(['prefix'=>'category'],function (){

        Route::any('getCategory','Category@getCategory');

    });

    Route::group(['prefix'=>'search'],function (){

        Route::any('search','Search@search');
        Route::any('search_list','Search@search_list');


    });

    Route::group(['prefix'=>'check'],function (){

        Route::any('checkLogin','Check@checkLogin');

    });


    Route::group(['prefix'=>'collect'],function (){

        Route::any('myCollect','Collect@myCollect');

    });

    Route::group(['prefix'=>'my'],function (){

        Route::any('historyList','My@historyList');

    });

    Route::group(['prefix'=>'snapped'],function (){

        Route::any('snapped_list','Snapped@snapped_list');

    });

    Route::group(['prefix'=>'store'],function (){

        Route::any('getStoreList','Store@getStoreList');

        Route::any('setDefaultStore','Store@setDefaultStore');

        Route::any('getDefaultStore','Store@getDefaultStore');

    });

    Route::group(['prefix'=>'mention'],function (){

        Route::any('getMentionData','Mention@getMentionData');

    });


});






//Route::any('/s','Weapp\Login@test2');
